//
// Created by 刘进伟 on 2018/5/22.
//

#ifndef COMPILER_SYNANALYZER_H
#define COMPILER_SYNANALYZER_H

#include <list>
#include <stack>
#include "Common.h"
#include "TokeErgo.h"

#define VN 67
#define VT 41

class SynAnalyzer {
private:
    std::list<LexType> synRules[104];
    std::stack<LexType > synStack;
    std::stack<int> synDeepth;

    int lineNumber=1;
    int currentDeepth;
    int LL1TABLE[VN][VT];
    TokeErgo & tokeErgo;

    void InitLL1Table();
    void CreateTable();
public:
    SynAnalyzer(TokeErgo & tokens);
    ~SynAnalyzer();
    void genSyntax();
};


#endif //COMPILER_SYNANALYZER_H
